package com.ztgf.order.models.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ztgf.common.annotations.CustomerBigDecimalSerialize;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/*
 * 后台管理系统订单导出VO
 * chenyu.wang
 * */
@Data
public class ExportAdminOrderListVO implements Serializable {

    @ApiModelProperty(value = "订单编号")
    private String orderNumber = "暂无信息";

    @ApiModelProperty(value = "订单状态")
    private String orderStatus = "暂无信息";

    @ApiModelProperty(value = "商品名称")
    private String productName = "暂无信息";

    @ApiModelProperty(value = "买家用户名")
    private String buyerUsername = "暂无信息";

    @ApiModelProperty(value = "卖家名称")
    private String sellerName;

    @ApiModelProperty(value = "收货人")
    private String consignee = "暂无信息";

    @ApiModelProperty(value = "收货人电话")
    private String consigneePhone = "暂无信息";

    @ApiModelProperty(value = "收货地址")
    private String shippingAddress = "暂无信息";

    @ApiModelProperty(value = "单价")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "数量")
    private Integer amount = 0;

    @ApiModelProperty(value = "商品总价")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal totalCommodityPrice;

    @ApiModelProperty(value = "改价优惠")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal changePriceDiscount;

    @ApiModelProperty(value = "批发优惠")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal wholesaleDiscount;

    @ApiModelProperty(value = "会员折扣优惠")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal memberDiscount;

    @ApiModelProperty(value = "优惠后金额")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal theAmountActuallyPaid;

    @ApiModelProperty(value = "实付金额")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal actuallyMoney;

    @ApiModelProperty(value = "下单时间")
    private String orderTime = "暂无信息";

    @ApiModelProperty(value = "全款支付时间")
    private String paymentTime = "暂无信息";

    @ApiModelProperty(value = "发货时间")
    private String deliveryTime = "暂无信息";

    @ApiModelProperty(value = "首款付款时间")
    private String firstPaymentTime = "暂无信息";

    @ApiModelProperty(value = "尾款付款时间")
    private String finalPaymentTime = "暂无信息";

    @ApiModelProperty(value = "签收时间")
    private String submissionTime = "暂无信息";

    @ApiModelProperty(value = "佣金支付时间")
    private String commissionPayTime = "暂无信息";

    @ApiModelProperty(value = "佣金退款时间")
    private String commissionRefundTime = "暂无信息";

    @ApiModelProperty(value = "配送方式")
    private String deliveryMethod = "暂无信息";

    @ApiModelProperty(value = "物流公司")
    private String logisticsCompany = "暂无信息";

    @ApiModelProperty(value = "物流单号")
    private String shipmentNumber = "暂无信息";

    @ApiModelProperty(value = "物流联系方式")
    private String logisticsContact = "暂无信息";

    @ApiModelProperty(value = "发票类型")
    private String invoiceType = "不开发票";

    @ApiModelProperty(value = "发票状态")
    private String invoiceState = "暂无信息";

    @ApiModelProperty(value = "开票信息")
    private String billingInformation = "暂无信息";

    @ApiModelProperty(value = "发票寄送地址")
    private String invoiceDeliveryAddress = "暂无信息";

    @ApiModelProperty(value = "备注信息")
    private String remarksInformation = "暂无信息";

    @ApiModelProperty(value = "实际佣金")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal commission;

    @ApiModelProperty(value = "预计佣金")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal estimateCommission;

    @ApiModelProperty(value = "退款金额")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal refundAmount;

    @ApiModelProperty(value = "询盘商品信息表id")
    private Long purchaseInfoId;

    @ApiModelProperty(value = "询盘商品砍价报名费")
    private BigDecimal purchaseFeeMoney;

    @ApiModelProperty(value = "询盘商品砍价服务费")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal purchaseFeeMoneyScalePrice;

    @ApiModelProperty(value = "商品砍价成功后的已退款服务费")
    @JsonSerialize(using = CustomerBigDecimalSerialize.class)
    private BigDecimal scaleBackPrice;



    @Override
    public boolean equals(Object o) {
        if (o instanceof ExportAdminOrderListVO) {
            ExportAdminOrderListVO exportAdminOrderListVO = (ExportAdminOrderListVO) o;
            if(null != exportAdminOrderListVO.purchaseInfoId){
                return this.orderNumber.equals(exportAdminOrderListVO.orderNumber)
                        && this.purchaseInfoId.equals(exportAdminOrderListVO.purchaseInfoId);
            }else{
                return this.orderNumber.equals(exportAdminOrderListVO.orderNumber);
            }

        }
        return super.equals(o);
    }

}
